﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;

namespace DayOfWeekClient
{
    class Client
    {
        static void Main(string[] args)
        {
            DateTime date = DateTime.Now;
            DayOfWeekService.DayOfWeekServiceClient jn = new DayOfWeekService.DayOfWeekServiceClient();
            //using (jn) 
            //{
            //    string result=
            //    jn.GetBgDay(date);
            //    Console.WriteLine(result);
            //http://localhost:1276/DayOfWeekBgService.svc/Category/{DATE}
            //}
            string parameter = "05-07-2011";
            string address = "http://localhost:1276/DayOfWeekBgService.svc/Category/";
            WebRequest request = WebRequest.Create(address + parameter);
            request.Method = "GET";
            
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            Stream dataStream = response.GetResponseStream();
            StreamReader reader = new StreamReader(dataStream);
            using (reader)
            {
                Console.WriteLine(reader.ReadToEnd());
            }
        }
    }
}
